<template>
  <div>
    <van-nav-bar :title="`${comment.reply_count}条回复`">
      <van-icon
        name="cross"
      />
    </van-nav-bar>
    <commont-item :item="comment"></commont-item>
    <van-cell title="全部回复"></van-cell>
    <commont-user :articleId="comment.com_id" :list="comList" type="c"></commont-user>
    <div class="bottom">
      <van-button block round @click="isPopupShow=true">点击发布 </van-button>
    </div>
    <van-popup
          v-model="isPopupShow"
          position="bottom"
        >
        <commont-talk :comId="articleId" :artId="comment.com_id" v-if="isPopupShow" @update="updateSucess"></commont-talk>
      </van-popup>
  </div>
</template>

<script>
// 评论回复组件
import commontItem from '@/components/commont-item'
import commontUser from '@/components/commont-user'
import commontTalk from '@/components/commonts/commont-talk'
export default {
  data () {
    return {
      isPopupShow: false,
      comList: []
    }
  },
  inject: ['articleId'],
  props: {
    comment: {
      type: Object,
      required: true
    }
  },
  components: {
    commontItem,
    commontUser,
    commontTalk
  },

  computed: {},
  methods: {
    updateSucess (v) {
      this.isPopupShow = false
      this.comList.unshift(v.new_obj)
    }
  }
}
</script>

<style lang='less' scoped>
.van-button--default{
  bottom: 0;
  left: 0;
  position: fixed;
  color: white;
  background:#ccc;
}
</style>
